package net.projecteuler.prob;

public class Problem71 implements Runnable{

	@Override
	public void run() {
		int dd = 0;
		double closeDist = 1.0;
		double exact = 3.0/7.0;
		
		for(int d = 2; d <= 1000000; d++){
			if(d % 7 == 0) continue;
			
			int n = d * 3 / 7;
			double ratio = (double)n / (double)d;
			if(closeDist > exact - ratio){
				dd = d;
				closeDist = exact - ratio;
				System.out.println(n + "/" + d + "=" + ratio);
			}
		}
		
		
	}

}
